package com.qys.livesMall.navy.controller.sys;

import com.qys.livesMall.common.result.R;
import com.qys.livesMall.navy.model.dto.EditNavyShopBalance;
import com.qys.livesMall.navy.model.dto.EditNavyShopName;
import com.qys.livesMall.navy.model.dto.NavyEditShop;
import com.qys.livesMall.navy.model.dto.NavyShopAddGoods;
import com.qys.livesMall.navy.service.NavyShopServer;
import com.qys.livesMall.shop.modal.dto.shop.ShopSearch;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * @menu 水军店铺操作
 * @date 2023/07/03 11:45
 */
@RestController
@RequestMapping("/sys/navy/shop/")
@Tag(name = "水军店铺管理", description = "水军店铺管理")
public class NavyShopController {

    @Resource
    private NavyShopServer navyShopServer;

    /**
     * 修改名称
     * @param navyShopName
     * @return
     */
    @PostMapping("editName")
    public R editName(@RequestBody EditNavyShopName navyShopName){
        return navyShopServer.editName(navyShopName);
    }

    @PostMapping("edit")
    public R edit(@RequestBody NavyEditShop navyEditShop){
        return navyShopServer.edit(navyEditShop);
    }

    /**
     * 赠送/扣除余额
     * @param shopBalance
     * @return
     */
    @PostMapping("editBalance")
    public R editBalance(@RequestBody EditNavyShopBalance shopBalance){
        return navyShopServer.editBalance(shopBalance);
    }

    @PostMapping("list")
    @Operation(summary = "水军店铺列表")
    public R listNavyShop(@RequestBody ShopSearch shopSearch){
        return navyShopServer.listNavyShop(shopSearch);
    }

    @PostMapping("addGoods")
    @Operation(summary = "水军店铺单个/批量添加商品")
    public R addProduct(@RequestBody NavyShopAddGoods navyShopAddGoods){
        return navyShopServer.addProduct(navyShopAddGoods);
    }

    @GetMapping("/detail/{shopId}")
    @Operation(summary = "水军店铺详情")
    public R getNavyShopDetail(@PathVariable("shopId") Long shopId){
        return navyShopServer.getNavyShopDetail(shopId);
    }


}

